package com.neuedu.learn;

public class DemoSwith {

    /**
     * switch
     *  100--90  A
     *  89---80  B
     *  79---70  C
     *  69----60 D
     *           E
     * @param args
     */
    public static void main(String[] args) throws Exception {

        int score = 45;
        if( score > 100 || score < 0){
            throw new Exception("录入的分数不对");
        }
        int scoreTen = score / 10 ;
        char charScore = ' ';
        switch ( scoreTen ){
            case 10 :
            case 9 :
                charScore = 'A';
                break;
            case 8 :
                charScore = 'B';
                break;
            case 7 :
                charScore = 'C';
                break;
            case 6 :
                charScore = 'D';
                break;
            default:
                charScore = 'E';
                break;


        }

        System.out.println("百分之  score = " + score);
        System.out.println("五级制 charScore " + charScore);

        //char, byte, short, int, Character, Byte, Short, Integer, String, or an enum
//        String vari = "";
//        switch (vari){
//            case "abc":
//                System.out.println("");
//                break;
//
//        }


    }

}
